home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8042 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: news-sop.inria.fr!usenet
  2. From: Herve Bernier <hbernier@sophia.inria.fr>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Heeelp: Interfacing Pascal object code with C. How?
  5. Date: Fri, 01 Mar 1996 08:15:12 +0100
  6. Organization: INRIA - Sophia Antipolis (France)
  7. Message-ID: <3136A400.15FB7483@sophia.inria.fr>
  8. References: <triant.825447166@pegasus.montclair.edu>
  9. NNTP-Posting-Host: rubis.inria.fr
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (X11; I; SunOS 4.1.3_U1 sun4m)
  14.  
  15. Hi from France
  16.  
  17. Constantine Triantafillou wrote:
  18. > Hi!
  19. > I am doing a programming project, developing a very simple imaginery
  20. > assembler:
  21. > However I have the following problem.
  22. > I am trying to find out how can I interface an object file
  23. > with a C program. Note that the object file is generated
  24. > by a Pascal compiler ...
  25.  
  26.  
  27. I do that interface a few years ago, but i don't remember all about that
  28.  
  29. If it could help you, the parameters are inverted between C and Pascal
  30. code
  31.  
  32. For exemple
  33.  
  34. Pascal : procedure Proc(a,b,c,d)
  35.  
  36. C      : Proc(d,c,b,a) or Proc_(d,c,b,a)
  37.      To know that, parse your pascal object file to see how the
  38.      procedure is defined. You also have to know that C compiler add 
  39.      an '_' at the beginning of a function, so if you see :
  40.         _Proc  -> it will be called Proc(...) by C program
  41.         _Proc_ -> it will be called Proc_(...) by C program
  42.  
  43. I don't remember neither about global/local variable (but i thing it's
  44. the same thing), nor about input/Output variables.
  45.  
  46.  
  47. Hope this will help you.
  48.  
  49. I someone need help about interfacing C and Fortran, i know a lot about
  50. it
  51.  
  52. Regards
  53.  
  54.                                 Herve Bernier
  55.                                 Ingenieur Expert
  56.                                 Projet SYSDYS - INRIA
  57.                                 hbernier@sophia.inria.fr
  58.